package com.yangcangclub.trade.service;

import com.alibaba.fastjson.JSONObject;
import com.yangcangclub.trade.bean.TradeRefund;
import com.yangcangclub.trade.bean.TradeSummary;
import com.yangcangclub.trade.bean.TradeVo;

import java.io.UnsupportedEncodingException;
import java.util.List;
import java.util.Map;

public interface TradeRefundService {
    /**退款申请（api）
     * @param userId
     * @param tradeId   订单id
     * @param refundType    退款类型
     * @param applyRefundPrice
     * @param applyRefundReasonType
     * @param applyRefundReason
     * @return
     * @throws Exception
     */
    public boolean applyTradeRefund(int userId,int tradeId,int productId,String refundType,
                                                String applyRefundPrice,int applyRefundReasonType,String applyRefundReason) throws Exception;

    /**退款订单列表
     * @param start   游标位置
     * @param pageSize  每页大小
     * @param map       查询条件
     * @return
     * @throws Exception
     */
    public Map<String, Object> applyTradeRefundList(int start, int pageSize, Map map) throws Exception;

    /**修改退款订单状态【前仅支持[G待确认]状态变更为[O已确认]状态】
     * @param auditId
     * @param auditName
     * @param tradeRefundId
     * @param status
     * @param remark
     * @return
     * @throws Exception
     */
    public boolean updateTradeRefundOperationStatus(int auditId,String auditName, int tradeRefundId,String status,String remark) throws Exception;

    /**发起退款
     * @param tradeRefundId
     * @param refundPrice
     * @param refundRemark
     * @param refundAccount
     * @return
     * @throws Exception
     */
    public Map tradeRefund(int tradeRefundId,String refundPrice,String refundRemark,String refundAccount) throws Exception;
    public TradeVo getTradeVoByTradeNoAndTradeRefundId(int tradeRefundId, String tradeNo) throws Exception;
}
